namespace FormApp
{
    public partial class Form1 : Form
    {
        //private TestDll _dll;
        public Form1()
        {
            InitializeComponent();

            Run();
        }
        private void Run()
        {
            TestDll.Init();

            var one = new TestDll.DemoStruct
            {
                Num = 1,
                Float = 1.2f,
                Double = 2.4
            };
            TestDll.StructAdd(one);

            var two = new TestDll.DemoStruct();
            TestDll.StructRead(0, ref two);
            Console.WriteLine("Test Add and Read");
            Console.WriteLine($"{two.Num}, {two.Float}, {two.Double}");

            Console.WriteLine("Test Adds");
            var tenValues = new List<TestDll.DemoStruct>();
            for (int i = 0; i < 10; i++)
            {
                var a = new TestDll.DemoStruct
                {
                    Num = i,
                    Float = i * 3.4f,
                    Double = i * 1.3
                };
                tenValues.Add(a);
            }
            TestDll.StructAdds(tenValues.ToArray(), tenValues.Count);

            var readTenValues = new List<TestDll.DemoStruct>();
            for (int i = 0; i < 10; i++)
            {
                var b = new TestDll.DemoStruct();
                TestDll.StructRead(i, ref b);
                Console.WriteLine($"{b.Num}, {b.Float}, {b.Double}");
                readTenValues.Add(b);
            }

            Console.WriteLine("Test Reads");

            var readValues = new TestDll.DemoStruct[10];
            var ids = new List<int>();
            for (var i = 0; i < 10; i++)
                ids.Add(i);

            TestDll.StructReads(ref ids.ToArray()[0], 10, ref readValues[0]);

            Console.WriteLine("Test Reads Over");

        }

        private void buttonAction_Click(object sender, EventArgs e)
        {


        }
    }
}